home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 302 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  882 b 

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: RND
  5. Date: 5 Jan 1996 21:29:45 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4ck589$g07@maureen.teleport.com>
  8. References: <709.6578T1027T1962@login.eunet.no>
  9. NNTP-Posting-Host: linda.teleport.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Patrick Hanevold (patrick.hanevold@login.eunet.no) wrote:
  13.  
  14.  I found this to be random enought for me :)
  15.  
  16.  MACRO RND
  17.     add.l    d1,d0    ;d0 = 'random'
  18.     swap    d0
  19.      add.l    d0,d1    ;d1 = 'random'
  20.  ENDM
  21.  
  22. ; INPUT:    A0.L = pointer to the RND structure
  23. ;        D0.L = rnd value 1
  24. ;        D1.L = rnd value 2
  25. Random:
  26.     ml    (a0)+,d0
  27.     ml    (a0),d1
  28.     RND
  29.     ml    d1,(a0)
  30.     ml    d0,-(a0)
  31.     rts
  32.  
  33.  It look lame but in my effects I work fine (I use it for stuff like
  34.  pixelize wipe, fire effects, random object placement etc..)
  35.  
  36.  Stephan
  37.